import tkinter as tk

class MainPage:
    def __init__(self, master):
        self.root = master
        self.page = tk.Frame(self.root)
        self.page.pack()
        self.root.geometry('600x400')
        self.create_page()

    def create_page(self):
        menubar = tk.Menu(self.root)

        menubar.add_command(label='录入')
        menubar.add_command(label='查询')

        # 显示菜单
        self.root.config(menu=menubar)

if __name__ =='__main__':
    root = tk.Tk()
    MainPage(root)
    root.mainloop()
